{% extends 'sales/base.html' %}
{% block content %}
<div class="row marl justify-content-center login_row">
  <div class="col-md-6 col-lg-6 col-xl-4">
    <div class="login_block">
      <div class="login_form_block">
        {% if validlink %}
        <h3 class="welcome">Change password</h3>
        <form method="post">
          {% csrf_token %}
          {{ form.as_p }}
          <button type="submit" class="btn btn-danger">Change password</button>
        </form>
        {% else %}
        <p>
          The password reset link was invalid, possibly because it has already been used.
          Please request a new password reset.
        </p>
        {% endif %}
      </div>
    </div>
  </div>
</div>

{% endblock %}
{% block js_block %}
<script type="text/javascript">
  $(document).ready(function () {
    $('ul').css('padding-left', '0')
    $('ul').css('margin-left', '0')
    $('li').css('font-size', '0.9em')
    $('li').css('list-style', 'none')
    $('input').addClass('form-control')
    $('input').addClass('form-control')
    $('.dropdown-menu').hide()
    $('.navbar-brand').removeClass('dropdown-toggle')
    $("label[for='id_new_password2']").html('Confirmation Password')
    $('.navbar-brand').click(function(e){
      e.preventDefault();
      window.location.href = '/';
    })
    $('#id_new_password2').after($('.errorlist'))
    $('.errorlist').addClass('mt-2')
    $('.errorlist > li').css('font-size', '1em')
    $('.errorlist > li').css('list-style', 'none')
    $('.errorlist > li').css('color', 'red')

  });

</script>
{% endblock js_block %}